module Spoj1Helper
  require "digest"
  include Configurator
  def md5_hash string_to_hash
    temp = Digest::MD5.new
    temp.update string_to_hash
    temp.hexdigest
  end
  def printable_time time 
    time.strftime("%Y-%b-%d %H:%M")
  end
  
  def sort_runs_by_tag name,method,problem,contest, user,current_order
    if current_order && (method == current_order or method == current_order[1,current_order.length])
      method = "-" + method if current_order[0,1] != '-'
    end
    link_to name,:action => :status,:order => method,
        :problem => problem, :contest => contest,:user => user
  end
end
